import Vue from 'vue'
import Router from 'vue-router'
import home from '../view/home'
import category from '../view/category'
import car from '../view/car'
import user from '../view/user'
import goodsThis from '../view/goodsThis'

import pay from '../view/pay'
import addressList from '../view/addressList'
import addressEdit from '../view/addressEdit'
import bankCard from '../view/bankCard'
import addBankCard from '../view/addBankCard'
import orderManage from '../view/orderManage'
import favorites from '../view/favorites'
import PSW from '../view/PSW'
import pswPay from '../view/pswPay'
import pswLogin from '../view/pswLogin'
import login from '../view/login'
import vault from '../view/vault'
import recharge from '../view/recharge'
import withdrawal from '../view/withdrawal'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '*',
      redirect: '/home',
      meta: { isShow: true }
    },

    {
      // 首页
      path: '/home',
      name: 'home',
      component: home,
      meta: { isShow: true }
    },
    // 分类
    {
      path: '/category',
      name: 'category',
      props: true,
      component: category,
      meta: { isShow: true }
    },
    {
      path: '/car',
      name: 'car',
      props: true,
      component: car,
      meta: { isShow: true }
    },
    {
      path: '/user',
      name: 'user',
      props: true,
      component: user,
      meta: { isShow: true }
    },
    {
      path: '/goodsThis/:id',
      name: 'goodsThis',
      props:true,
      component: goodsThis,
      meta: { isShow: false}
    },
    
    {
      path: '/pay',
      name: 'pay',
      props:true,
      component: pay,
      meta: { isShow: false}
    },
    {
      path: '/addressList',
      name: 'addressList',
      props:true,
      component: addressList,
      meta: { isShow: false}
    },
    {
      path: '/addressEdit',
      name: 'addressEdit',
      props:true,
      component: addressEdit,
      meta: { isShow: false}
    },
    {
      path: '/bankCard',
      name: 'bankCard',
      props:true,
      component: bankCard,
      meta: { isShow: false}
    },
    {
      path: '/addBankCard',
      name: 'addBankCard',
      props:true,
      component: addBankCard,
      meta: { isShow: false}
    },
    {
      path: '/orderManage',
      name: 'orderManage',
      props:true,
      component: orderManage,
      meta: { isShow: false}
    },
    {
      path: '/favorites',
      name: 'favorites',
      props:true,
      component: favorites,
      meta: { isShow: false}
    },
    {
      path: '/PSW',
      name: 'PSW',
      props:true,
      component: PSW,
      meta: { isShow: false}
    },
    {
      path: '/pswPay',
      name: 'pswPay',
      props:true,
      component: pswPay,
      meta: { isShow: false}
    },
    {
      path: '/pswLogin',
      name: 'pswLogin',
      props:true,
      component: pswLogin,
      meta: { isShow: false}
    },
    {
      path: '/login',
      name: 'login',
      props:true,
      component: login,
      meta: { isShow: false}
    },
    {
      path: '/vault',
      name: 'vault',
      props:true,
      component: vault,
      meta: { isShow: false}
    },
    {
      path: '/recharge',
      name: 'recharge',
      props:true,
      component: recharge,
      meta: { isShow: false}
    },
    {
      path: '/withdrawal',
      name: 'withdrawal',
      props:true,
      component: withdrawal,
      meta: { isShow: false}
    },
  ]
});